package com.jinhua.usercenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jinhua.usercenter.model.User;
import com.jinhua.usercenter.model.VO.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 20289
* @description 针对表【j_user(用户)】的数据库操作Service
* @createDate 2024-08-29 17:40:52
*/
public interface UserService extends IService<User> {
    /**
     * 用户注册
     * @param username 用户名称
     * @param userAccount   用户账号
     * @param password      用户密码
     * @param checkPassword 检查密码
     * @param phone         手机号
     * @param email         邮箱
     * @param avatarUrl     头像url
     * @param gender        性别
     * @return              用户id
     */
    long registUser(String username,
                    String userAccount,
                    String password,
                    String checkPassword,
                    String phone,
                    String email,
                    String  avatarUrl,
                    Integer gender);

    /**
     * 用户登陆
     * @param userAccount   登陆账号
     * @param password      登陆密码
     * @param request       获取session存储登陆用户
     * @return              返回登陆用户信息
     */
    UserVO doLogin(String userAccount, String password, HttpServletRequest request);

    /**
     * 检查权限
     * @param request 获取登陆用户
     * @return 权限通过返回true 否则返回false
     */
    boolean authCheck(HttpServletRequest request);

    User getLoginUser(HttpServletRequest request);

    UserVO getUserVO(User user);

    List<UserVO> getListUserVO(List<User> userList);



}
